import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['svg.fonttype'] = 'none'

# 创建数据框架
data = {
    'Round': [5, 10, 15, 20, 25, 30, 35, 40, 45, 50],
    'SPS': [0.196250338,0.255761223,0.193900061,0.185564872,0.149530234,0.144792631,0.158687287,0.162518144,0.089264933,0.075483904],
    'OGS': [0.428761401,0.332633323,0.31562333,0.334748918,0.237843063,0.224942007,0.187580893,0.321805029,0.18084776,0.218799978],
    'ORDP': [0.39192374,0.363551305,0.247705209,0.253938336,0.208331077,0.205414682,0.192171278,0.17962929,0.184848343,0.202577033],
}

df = pd.DataFrame(data)

# 绘制数据
plt.figure(figsize=(8, 6))
plt.plot(df['Round'], df['SPS'], marker='s', markersize=10, label='SPS')
plt.plot(df['Round'], df['OGS'], marker='^', markersize=10, label='OGS')
plt.plot(df['Round'], df['ORDP'], marker='*', markersize=10, label='ORDP')

# plt.title('Comparison of SPF and Cplex Algorithms')
plt.xlabel('Round', fontsize=14)
plt.ylabel('Resource Utilization (%)', fontsize=14)
plt.legend(fontsize='large')  # 设置图例的字体大小为大

plt.grid(True)
# plt.show()
plt.savefig("output/in_cluster_ru_var_capacity.svg", format="svg")
